/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package backingBean;

import entities.Clinsdoeil;
import java.util.ArrayList;
import java.util.List;
import javaServices.ClindoeilManager;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import static org.icefaces.mobi.component.dataview.ColumnType.bool;

/**
 *
 * @author michael
 */
@ManagedBean(name = "clinsdoeil")
@RequestScoped
public class ClinsdoeilMB {

    private Clinsdoeil clinsdoeil;
    private boolean like ;
    
    /**
     * Creates a new instance of ClinsdoeilMB
     */
    public ClinsdoeilMB() {
        
    }

    public Clinsdoeil getClinsdoeil() {
        return clinsdoeil;
    }

    public void setClinsdoeil(Clinsdoeil clinsdoeil) {
        this.clinsdoeil = clinsdoeil;
    }

    public boolean isLike() {
        return like;
    }

    public void setLike(boolean like) {
        this.like = like;
    }
    
    
    
    public void putClinsdoeil(int idToMembers){
        
        
        clinsdoeil.setIdMembers(1);
        clinsdoeil.setIdFromMembers(idToMembers);
        clinsdoeil.setLike(1);
        
        ClindoeilManager.insertClinsdoeil(clinsdoeil);
    }
    
    public ArrayList<Boolean> getLikeForCurrentUser(){
        ArrayList<Boolean> list =  new ArrayList<Boolean>();
        
        List<Clinsdoeil> tempClin = ClindoeilManager.getClinsdoeilByUserId(1);
        
        for(Clinsdoeil cd : tempClin){
//            cd.getLike()
        }
        
        return list;
    }
}
